#include<iostream>
using namespace std;
const int N = 5e4 + 10;
int p[N];
int n, m, q;
int a, b;
int find(int x)
{
	if (x != p[x]) {
		p[x] = find(p[x]);
	}
	return p[x];
}
int main()
{
	cin >> n >> m >> q;
	for (int i = 1; i <= n; i++) {
		p[i] = i;
	}
	while (m--) {
		cin >> a >> b;
		a = find(a);
		b = find(b);
		if (a != b) {
			p[a] = b;
		}
	}
	while (q--) {
		cin >> a >> b;
		a = find(a);
		b = find(b);
		if (a == b) {
			cout << "Yes" << endl;
		}
		else
			cout << "No" << endl;
	}
	return 0;
}